<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>对象1</title>
	<script type="text/javascript">

		function Car () {
			this.color = "红色";
			this.name ="奥迪";
			this.length = '4M';
			this.i='这个是I';
			this.zairen = function  () {
				alert("可以载人");
			}
			this.run = function  (x) {
				alert(x+"可以跑");
			}
			this.gaoji = function  () {
				alert("可以搞基");
			}
		}

		var obj = new Car();

		console.log(obj);

		// alert(obj.color);

		for (var i in obj) {
			// document.write(i);
			document.write(obj[i]);
		};

		// obj.width = "2m";

		// obj.fly = function () {
		// 	alert("可以飞");
		// }

		// obj.fly();

		// alert(obj.run('小明'));


		// var arr = [45,45,45,45,234];

		// arr.push(9999);

		// alert(arr);


		var jsonObj = {'name':'学并思','sex':'男','age':'18'};

		// for (var x in jsonObj) {
		// 	document.write(jsonObj[x]);
		// 	document.write('<br>');
		// };

		// jsonObj.name

		// json xml

		// var txt = '';

		// var person={fname:"Bill",lname:"Gates",age:56};

		// for (var x in person){
	 //  		txt = txt + person.x;
	 //  	}


	 	var obj = new Object();

	 	obj.sex = "男";
	 	obj.name="学并思";
	 	obj.run = function  () {
	 		alert("可以跑");
	 	}


	 	// document.write(obj.sex);
	 	// obj.run();


	 	function Dongwu (x) {
	 		this.color=x;
	 		this.name='猫';
	 		this.eat = function  () {
	 			alert('可以吃的');
	 		}

	 	}

	 	var obj = new Dongwu('蓝色');

	 	// document.write(obj.color);
	 	// obj.eat();


	 	var person={fname:"Bill",lname:"Gates",age:56};

		for (var x in person){
	  		alert(person[x]);
	  	}




	</script>
</head>
<body>
	
</body>
</html>